img0 = new Image();
img0.src = 'http://gfx1.bryk.pl/graphics/bctop.gif';
img1 = new Image();
img1.src = 'http://gfx1.bryk.pl/graphics/bhtop.gif';
img2 = new Image();
img2.src = 'http://gfx1.bryk.pl/graphics/bntop.gif';
img3 = new Image();
img3.src = 'http://gfx1.bryk.pl/graphics/bcnew.gif';
img4 = new Image();
img4.src = 'http://gfx1.bryk.pl/graphics/bhnew.gif';
img5 = new Image();
img5.src = 'http://gfx1.bryk.pl/graphics/bnnew.gif';
img6 = new Image();
img6.src = 'http://gfx1.bryk.pl/graphics/bhforum.gif';
img7 = new Image();
img7.src = 'http://gfx1.bryk.pl/graphics/bnforum.gif';
img8 = new Image();
img8.src = 'http://gfx1.bryk.pl/graphics/bhhydepark.gif';
img9 = new Image();
img9.src = 'http://gfx1.bryk.pl/graphics/bnhydepark.gif';
img10 = new Image();
img10.src = 'http://gfx1.bryk.pl/graphics/box_border.gif';
img11 = new Image();
img11.src = 'http://gfx1.bryk.pl/graphics/box_tl.gif';
img12 = new Image();
img12.src = 'http://gfx1.bryk.pl/graphics/box_tr.gif';
img13 = new Image();
img13.src = 'http://gfx1.bryk.pl/graphics/box_bl.gif';

function showItem(itemID)
{
	var obj = document.getElementById(itemID);
	if (obj)
		obj.style.display = '';
}

function hideItem(itemID)
{
	var obj = document.getElementById(itemID);
	if (obj)
		obj.style.display = 'none';
}

function toggleItem(itemID)
{
	var obj = document.getElementById(itemID);
	if (obj)
	{
		if (obj.style.display == 'none')
			obj.style.display = '';
		else
			obj.style.display = 'none';
	}
}

function fixSkyscraper()
{
	var obj = document.getElementById('ad_skyscraper');
	var obj1 = document.getElementById('top');
	var obj2 = document.getElementById('top_center');
	var obj3 = document.getElementById('ad_megabanner');
	if (obj && obj1 && obj2/* && obj3*/)
	{
		obj.style.left = (Math.max(obj1.offsetLeft + 3, obj2.offsetLeft) + 777) + 'px';
		if (obj3 && (obj3.offsetTop > 0))
			obj.style.top = obj3.offsetTop + obj3.offsetParent.offsetTop + /* obj3.offsetParent.offsetParent.offsetTop +*/ obj3.offsetHeight +  156 + 'px';
		else
			obj.style.top = '362px';
//		obj.style.top = Math.max(obj3.offsetTop + obj3.offsetParent.offsetTop + obj3.offsetParent.offsetParent.offsetTop + obj3.offsetHeight + 5, document.documentElement.scrollTop) + 'px';
		obj.style.visibility = 'visible';
		obj.style.display = 'block';
	}
}

function addOnScroll()
{
//	window.onscroll = fixSkyscraper;
	window.onresize = fixSkyscraper;
}

function showBlend()
{
	var obj = document.getElementById('blend');
	if (obj)
	{
		document.documentElement.scrollTop = 0;
		var tohide = document.getElementsByTagName('select');
		for (i = 0; i < tohide.length; i++)
			tohide[i].style.visibility = 'hidden';
		obj.style.height = document.body.clientHeight + 'px';
		obj.style.width = document.body.clientWidth + 'px';
		obj.style.display = '';
		obj = document.getElementById('onblend');
		if (obj)
		{
			obj.style.display = '';
			obj.style.top = (document.body.clientHeight - obj.clientHeight) / 2 + 'px'
			obj.style.left = (document.body.clientWidth - obj.clientWidth) / 2 + 'px'
			obj.style.visibility = '';
		}
	}
}

function hideBlend()
{
	window.onscroll = null;
	var obj = document.getElementById('onblend2');
	obj.style.display = 'none';
	obj = document.getElementById('blend2');
	obj.style.display = 'none';
	var obrazek = document.getElementById('zdjecie');
	obrazek.src = 'http://gfx1.bryk.pl/graphics/wait.gif';
}

function addBookmark(url, title)
{
	if (window.sidebar)
		window.sidebar.addPanel(title, url, "");
	else if (document.all)
		window.external.AddFavorite(url, title);
	else if (window.opera && window.print)
		return true;
}

function writeOpenTable()
{
	document.write('<table class="layout">');
}

function writeCloseTable()
{
	document.write('</table>');
}

function writeVertSpacer()
{
	document.write('<tr><td class="vspace"></td></tr>');
}

function writeTextSWF(name, width, height, content, color)
{
	document.write('<span id="' + name + '"> </span>');
	var textswf = new SWFObject('http://gfx1.bryk.pl/graphics/text.swf', name + '_swf', width, height, '6', '#FFFFFF');
	textswf.addParam('wmode', 'transparent');
	textswf.addParam('menu', 'false');
	textswf.addVariable('tekst', content);
	textswf.addVariable('tekst_kolor', color);
	textswf.write(name);
}

var user_id;
user_id = 0;

function friends_show(element_id)
{
	var obj;
	if (!user_id || (user_id.id != "usun_znajomosc" && user_id.id != "usun_znajomosc2" && user_id.id != "dodaj_znajomosc"))
	{
		obj = document.getElementById(element_id);
		user_id = obj;
	}
}

function friends_hide(element_id)
{
	var obj;
	obj = document.getElementById(element_id);
	if (obj)
		obj.style.display = "none";
	user_id = 0;
}

function position(config)
{
	var offset;
	offset = 15;
	x = config.clientX;
	y = config.clientY;
	if (user_id)
	{
		user_id.style.top = y + offset + document.documentElement.scrollTop + "px";
		user_id.style.left = x + offset + document.documentElement.scrollLeft + "px";
		user_id.style.display = "";
	}
}

function refreshCode()
{
	document.getElementById('code').src='code.php?refresh='+(Math.random()*100000000000000000).toString();
}
